<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />

<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>活动设置</title>
</head>
<body>
<div class="pd-20">
	<form action="" method="post" class="form form-horizontal" id="form1">
		<input type="hidden" name="act_id" id="act_id">
		<div class="row cl">
			<label class="form-label col-3">活动名称：</label>
			<div class="formControls col-4">
				<input type="text" class="input-text" value="" placeholder="" id="activity_name" name="activity_name">
			</div>
			<div class="col-3"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">链接：</label>
			<div class="formControls col-4">
				<input type="text" class="input-text" value="" placeholder="" id="activity_url" name="activity_url">
			</div>
			<div class="col-3"> </div>
		</div>

		<div class="row cl">
			<label class="form-label col-3">扣券/次：</label>
			<div class="formControls col-4">
				<input type="text" class="input-text" value="" placeholder="" id="act_quan" name="act_quan">
			</div>
			<div class="col-3"> </div>
		</div>

		<div class="row cl">
			<label class="form-label col-3">参与次数/天：</label>
			<div class="formControls col-4">
				<input type="text" class="input-text" value="" placeholder="" id="act_times" name="act_times">
			</div>
			<div class="col-3"> </div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-3">活动时间：</label>
			<div class="formControls col-4">
				<input class="input-text datainp" id="activity_time" type="text" name="activity_time" value="" >
			</div>
			<div class="col-3"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3">活动说明：</label>
			<div class="formControls col-6">
				<textarea name="activity_content" id="activity_content" cols="" rows="5" class="textarea"  placeholder="活动说明..." ></textarea>
				<!-- <p class="textarea-numberbar"><em class="textarea-length">0</em>/200</p> -->
			</div>
			<div class="col-3"> </div>
		</div>

		
		<div class="row cl">
			<label class="form-label col-3">缩略图：</label>
			<div class="formControls col-8" >				
				<div class="l mb-10 fj-img" id="imgslt" >					
				</div>		
				<i class="Hui-iconfont fj-img-btn" onclick="_open('缩略图','article-imageupload.html?type=image&idname=imgslt&api=activity&single=1&inputname=activity_image','750px','470px',true)">&#xe610;</i>	 
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-3">开启活动：</label>
			<div class="formControls col-3 s-msg">
			    <div class="radio-box">
			        <label class="lh-26">
			        	<input type="radio" name="is_open" value="1" >开启
			        </label>
			    </div>
			    <div class="radio-box">
			        <label class="lh-26">
			        	<input type="radio" name="is_open" value="0" checked>关闭
			        </label>
			     </div>
			</div>
			
		</div>	
		

		
		
		<div class="row cl pr-20" style="position:fixed; bottom:10px; width: 200px; right: 10px; text-align: right; z-index:1000; ">
	
				<button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
				<button onClick="removeIframe();" class="btn btn-default radius" type="button" style="margin-left:10px;">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			
		</div>

	</form>
</div>
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 

<script type="text/javascript" src="lib/Validform/5.3.2/Validform.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.1/layer.js"></script> 
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script> 
<script type="text/javascript" src="js/s.js"></script> 

<script type="text/javascript" src="lib/daterangepicker/moment.min.js"></script> 
<script type="text/javascript" src="lib/daterangepicker/jquery.daterangepicker.js"></script>
<link rel="stylesheet" href="lib/daterangepicker/daterangepicker.css" /> 
<script type="text/javascript">
var API=API_ACTIVITY;
$("#form1").attr("action", API);
$('#activity_time').dateRangePicker(
	{
		autoClose: true,
		singleDate : false,
		showShortcuts: false,
		singleMonth: true,


		startOfWeek: 'monday',
		format: 'YYYY-MM-DD HH:mm:ss',
		time: {
			enabled: true
		},
		defaultTime: moment().startOf('day').toDate(),
		defaultEndTime: moment().endOf('day').toDate(),

	});
$(function(){

var editid=getUrlParam('editid');//编辑分类id
	if(editid!=null){
	    var eidturl=API+"?id="+editid;
	    $("#form1").attr("action", eidturl);
	    $.getJSON(eidturl,function(data){
	    	if(!checkStatus(data)) return;
	
	    		$("input[name='activity_name']").val(data.datas.activity_name);
    			$("textarea[name='activity_content']").val(data.datas.activity_content);
	    		$("input[name='activity_url']").val(data.datas.activity_url);
				$("input[name='activity_time']").val(data.datas.begin_time+' to '+data.datas.end_time);
				$("input[name='act_times']").val(data.datas.act_times);
				$("input[name='act_quan']").val(data.datas.act_quan);
	


    			

    			$("input[name='is_open'][value="+data.datas.is_open+"]").attr("checked",true);
	    		    // 缩略图
	    		    if(data.datas.activity_image){
	    		    	    var activity_image=data.datas.activity_image;

	    		    		$('#imgslt').append('<li><img src="'+activity_image+'"><i class="Hui-iconfont fun-img-del" data-id="#imgslt" data-inputname="activity_image">&#xe706;</i><input type="hidden" name="activity_image" value="'+activity_image+'"></li>');	
	    		    		
	    		    }
	    		    
	        
	    })
	}





	

	Validformsubmit("#form1");
});
</script>
</body>
</html>